package com.gao.filters;

import javax.servlet.*;
import java.io.IOException;

/**
 * 原生Filter实现
 *
 * @author GaoXi
 * @date 2021/8/18 17:33
 */
public class OriginalFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("过滤1");
        filterChain.doFilter(servletRequest,servletResponse);
        System.out.println("过滤2");
    }

    @Override
    public void destroy() {
        System.out.println("destory");
    }
}
